package com.godpaper.chessGameHall.busniess.delegates
{
	import com.godpaper.chessGameHall.managers.ProgressBarManager;
	
	import mx.managers.CursorManager;
	import mx.rpc.IResponder;
	import mx.rpc.http.HTTPService;

	public class DelegateBase implements IResponder
	{
		protected var responder:IResponder;
		protected var service:HTTPService;
		
		public function DelegateBase(responder:IResponder)
		{
			this.responder = responder;
		}
		//result or fault
		virtual public function result(data:Object):void
		{
			responder.result(data);
			CursorManager.removeBusyCursor();
			ProgressBarManager.removeProgressBar();
		}
		
		public function fault(info:Object):void
		{
			responder.fault(info);
			CursorManager.removeBusyCursor();
			ProgressBarManager.removeProgressBar();
		}
		
		protected function setProgressStatus(setBusyCursor:Boolean,showProgressBar:Boolean):void
		{
			if(setBusyCursor)
			{
				CursorManager.setBusyCursor();
			}
			if(showProgressBar)
			{
				ProgressBarManager.showProgressBar();
			}
		}
	}
}